package com.ourteam.system.domain;

import net.dao.IDataPopulateCallback;

import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

import java.util.HashMap;

/**
 * Template Name : DTO数据对象
 * Template Version : 1
 * Template Last Modfiy Date : Thu Jul 12 16:34:06 CST 2018
 * Auto Generate Date : 2018-07-20 12:04:46
  * Warning ! This file will be overwrite when regenerate !
  *
 */
import java.util.Map;


public class SystemRole implements java.io.Serializable {
    private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

    static {
        mappedDaoFields.put("domainId",
            com.ourteam.system.dao.ISysRoleDAO.DomainId);

        mappedDaoFields.put("id", com.ourteam.system.dao.ISysRoleDAO.Id);

        mappedDaoFields.put("remarks",
            com.ourteam.system.dao.ISysRoleDAO.Remarks);

        mappedDaoFields.put("code", com.ourteam.system.dao.ISysRoleDAO.RoleCode);

        mappedDaoFields.put("name", com.ourteam.system.dao.ISysRoleDAO.RoleName);

        mappedDaoFields.put("type", com.ourteam.system.dao.ISysRoleDAO.RoleType);

        mappedDaoFields.put("status", com.ourteam.system.dao.ISysRoleDAO.Status);

        mappedDaoFields.put("domainTitleKey",
            com.ourteam.system.dao.ISysRoleDAO.DomainTitleKey);

        mappedDaoFields.put("domainName",
            com.ourteam.system.dao.ISysRoleDAO.DomainName);

        mappedDaoFields.put("domainCode",
            com.ourteam.system.dao.ISysRoleDAO.DomainCode);

        mappedDaoFields.put("defaultFlag",
            com.ourteam.system.dao.ISysRoleDAO.DefaultFlag);

        mappedDaoFields.put("domainSortIndex",
            com.ourteam.system.dao.ISysRoleDAO.DomainSortIndex);

        mappedDaoFields.put("domainIcon",
            com.ourteam.system.dao.ISysRoleDAO.DomainIcon);

        mappedDaoFields.put("modifyTime",
            com.ourteam.system.dao.ISysRoleDAO.ModifyTime);

        mappedDaoFields.put("operatorId",
            com.ourteam.system.dao.ISysRoleDAO.OperatorId);

        mappedDaoFields.put("operatorName",
            com.ourteam.system.dao.ISysRoleDAO.OperatorName);
    }

    private com.ourteam.system.dao.SysRole sysRole;

    public SystemRole() {
        super();

        this.sysRole = new com.ourteam.system.dao.SysRole();
    }

    public SystemRole(com.ourteam.system.dao.SysRole sysRole) {
        super();

        this.sysRole = sysRole;
    }

    protected BeanMap getBeanMap() {
        return new BeanMap(sysRole);
    }

    public static String getMappedDAOField(String aAttrName) {
        return mappedDaoFields.get(aAttrName);
    }

    public com.ourteam.system.dao.SysRole convertToSysRole() {
        return this.sysRole;
    }

    public com.ourteam.system.dao.SysRole convertTo() {
        return this.sysRole;
    }

    /**
     * Get domainId
     *
     * @return long
     */
    public long getDomainId() {
        return (long) this.sysRole.getDomainId();
    }

    /**
     * Set domainId
     *
     * @parameter long
     */
    public void setDomainId(long domainId) {
        this.sysRole.setDomainId(domainId);
    }

    /**
     * Get id
     *
     * @return long
     */
    public long getId() {
        return (long) this.sysRole.getId();
    }

    /**
     * Set id
     *
     * @parameter long
     */
    public void setId(long id) {
        this.sysRole.setId(id);
    }

    /**
     * Get remarks
     *
     * @return String
     */
    public String getRemarks() {
        return (String) this.sysRole.getRemarks();
    }

    /**
     * Set remarks
     *
     * @parameter String
     */
    public void setRemarks(String remarks) {
        this.sysRole.setRemarks(remarks);
    }

    /**
     * Get code
     *
     * @return String
     */
    public String getCode() {
        return (String) this.sysRole.getRoleCode();
    }

    /**
     * Set code
     *
     * @parameter String
     */
    public void setCode(String code) {
        this.sysRole.setRoleCode(code);
    }

    /**
     * Get name
     *
     * @return String
     */
    public String getName() {
        return (String) this.sysRole.getRoleName();
    }

    /**
     * Set name
     *
     * @parameter String
     */
    public void setName(String name) {
        this.sysRole.setRoleName(name);
    }

    /**
     * Get type
     *
     * @return String
     */
    public String getType() {
        return (String) this.sysRole.getRoleType();
    }

    /**
     * Set type
     *
     * @parameter String
     */
    public void setType(String type) {
        this.sysRole.setRoleType(type);
    }

    /**
     * Get status
     *
     * @return String
     */
    public String getStatus() {
        return (String) this.sysRole.getStatus();
    }

    /**
     * Set status
     *
     * @parameter String
     */
    public void setStatus(String status) {
        this.sysRole.setStatus(status);
    }

    /**
     * Get domainTitleKey
     *
     * @return String
     */
    public String getDomainTitleKey() {
        return (String) this.sysRole.getDomainTitleKey();
    }

    /**
     * Get domainName
     *
     * @return String
     */
    public String getDomainName() {
        return (String) this.sysRole.getDomainName();
    }

    /**
     * Get domainCode
     *
     * @return String
     */
    public String getDomainCode() {
        return (String) this.sysRole.getDomainCode();
    }

    /**
     * Get defaultFlag
     *
     * @return String
     */
    public String getDefaultFlag() {
        return (String) this.sysRole.getDefaultFlag();
    }

    /**
     * Set defaultFlag
     *
     * @parameter String
     */
    public void setDefaultFlag(String defaultFlag) {
        this.sysRole.setDefaultFlag(defaultFlag);
    }

    /**
     * Get domainSortIndex
     *
     * @return int
     */
    public int getDomainSortIndex() {
        return (int) this.sysRole.getDomainSortIndex();
    }

    /**
     * Get domainIcon
     *
     * @return String
     */
    public String getDomainIcon() {
        return (String) this.sysRole.getDomainIcon();
    }

    /**
     * Get modifyTime
     *
     * @return java.util.Date
     */
    public java.util.Date getModifyTime() {
        return (java.util.Date) this.sysRole.getModifyTime();
    }

    /**
     * Set modifyTime
     *
     * @parameter java.util.Date
     */
    public void setModifyTime(java.util.Date modifyTime) {
        this.sysRole.setModifyTime(modifyTime);
    }

    /**
     * Get operatorId
     *
     * @return long
     */
    public long getOperatorId() {
        return (long) this.sysRole.getOperatorId();
    }

    /**
     * Set operatorId
     *
     * @parameter long
     */
    public void setOperatorId(long operatorId) {
        this.sysRole.setOperatorId(operatorId);
    }

    /**
     * Get operatorName
     *
     * @return String
     */
    public String getOperatorName() {
        return (String) this.sysRole.getOperatorName();
    }

    public int hashCode() {
        return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } // end if

        if ((obj instanceof SystemRole) == false) {
            return false;
        } // end if

        SystemRole other = (SystemRole) obj;

        boolean isEqual = false;

        com.ourteam.system.dao.SysRole tempSysRole = other.convertToSysRole();

        if ((tempSysRole == null) || (this.sysRole == null)) {
            isEqual = false;
        } else if ((tempSysRole == this.sysRole) ||
                tempSysRole.equals(this.sysRole)) {
            isEqual = true;
        } else {
            isEqual = false;
        }

        return isEqual;
    }

    public static SystemRole[] toArray(
        com.ourteam.system.dao.SysRole[] aSysRoles) {
        return toArray(aSysRoles, null);
    }

    public static SystemRole[] toArray(
        com.ourteam.system.dao.SysRole[] aSysRoles,
        IDataPopulateCallback aCallBack) {
        if (ArrayUtils.isEmpty(aSysRoles)) {
            return new SystemRole[0];
        }

        int length = aSysRoles.length;

        SystemRole[] beans = new SystemRole[length];

        for (int i = 0; i < length; i++) {
            beans[i] = new SystemRole(aSysRoles[i]);

            if (aCallBack != null) {
                aCallBack.populate(beans[i], new Object[] { aSysRoles[i] });
            }
        }

        return beans;
    }
}
